<template>
  <div>
    <el-container>
      <el-header>
        <FHeader/>
      </el-header>
      <el-container>
        <!-- 左侧菜单 -->
        <el-aside :width="store.asideWidth">
          <FMenu/>
        </el-aside>
        <el-main>
          <FTagList/>
          <!-- 动画效果，如果动画效果失效，页面上用一个 div 标签，把整个页面包起来  -->
          <router-view v-slot="{ Component }">
            <transition name="fade">
              <keep-alive :max="10">
                <component :is="Component">

                </component>
              </keep-alive>
            </transition>
          </router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script setup>

import FHeader from './components/FHeader.vue';
import FMenu from './components/FMenu.vue';
import FTagList from './components/FTagList.vue';
import {mainStore} from "../store";

const store = mainStore()

</script>
<style scoped>
.el-aside {
  transition: all 0.2s;
}

.fade-enter-from {
  opacity: 0;
}

.fade-enter-to {
  opacity: 1;
}

.fade-leave-from {
  opacity: 1;
}

.fade-leave-to {
  opacity: 0;
}

.fade-enter-active,
.fade-leave-active {
  transition: all 0.3s;
}

.fade-enter-active {
  transition-delay: 0.3s;
}
</style>
